<template>
  <div class="home">
    <img alt="Vue logo" src="../assets/logo.png" />
    <button @click="send">发送请求</button>
  </div>
</template>

<script lang="ts">
import { defineComponent, reactive } from "vue"
import { login } from "@/api/main/login"
import cache from "@/utils/cache"
export default defineComponent({
  name: "Home",
  setup(props) {
    const loginForm = reactive({
      username: "xfy",
      password: "123"
    })
    console.log(loginForm.username)
    login(loginForm).then(res => {
      console.log(res)
    })
    const val = cache.getCache("xfy")
    const send = () => {
      console.log("发送了")
      login(loginForm).then(res => {
        console.log(res)
      })
    }
    return {
      send
    }
  }
})
</script>
